package hv.fmw.utils {
	import flash.text.StyleSheet;
	import flash.utils.Dictionary;

	/**
	 * Singleton  Labels
	 *
	 *
	 * @author Herve Vong
	 * @created 23 sept. 2009
	 */
	public class Labels {
		
		private static var _labels:Dictionary = new Dictionary();
		public static var styleSheet:StyleSheet = new StyleSheet();
				
		/*
		 * Populate data from labels.xml to an array
		 */
		public static function populate(node:XMLList):void {
			var l:int = node.length();
			var label:XML;
			for(var i:int=0; i<l; i++){
				label = node[i];
				_labels[String(label.@id)] = label;
			}
		}
		
		/*
		 * Get label from labels.xml with its code
		 */
		public static function getLabel(code:String):String {
			return _labels[code];
		}
	}
}